//
//  PersonItemView.swift
//  XMYouPin
//
//  Created by 王宗成 on 2019/8/2.
//  Copyright © 2019 王宗成. All rights reserved.
//

import UIKit

class PersonItemView: UIView {

    public lazy var bgImgView : UIImageView = {
        let imageView = UIImageView()
        imageView.clipsToBounds = true
        self.addSubview(imageView)
        return imageView
    }()
    
    public lazy var titleLabel : UILabel = {
        let label = UILabel()
        label.font = UIFont.systemFont(ofSize: 12)
        label.textColor = UIColor.hexColor(hexadecimal: "#000000")
        label.textAlignment = NSTextAlignment.left
        self.addSubview(label)
        return label
    }()
    
    public lazy var subTitleLabel : UILabel = {
        let label = UILabel()
        label.font = UIFont.systemFont(ofSize: 10)
        label.textColor = UIColor.hexColor(hexadecimal: "#999999")
        label.textAlignment = NSTextAlignment.center
        self.addSubview(label)
        return label
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.bgImgView.snp.makeConstraints { (make) in
            
            make.top.centerX.equalToSuperview()
            make.size.equalTo(CGSize(width: 28, height: 28))
        }
        
        self.titleLabel.snp.makeConstraints { (make) in
            
            make.centerX.equalToSuperview()
            make.top.equalTo(self.bgImgView.snp_bottom).offset(8)
            
        }
        self.subTitleLabel.snp.makeConstraints { (make) in
            
            make.centerX.equalToSuperview()
            make.top.equalTo(self.titleLabel.snp_bottom)
           
        }
    }
    
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}
